#ifndef PRIVATE_H
#define PRIVATE_H

#include "gpio_if.h"

#define MESG_HEAD 0xC1

#define LEFT_SWITCH   17 
#define RIGHT_SWITCH  18

#define MODEBUS_DEV  "/dev/uartdev-5"
#define E22_DEV      "/dev/uartdev-7"

//引脚中断触发方式
#define POSITIVE_EDGE  0x00
#define NEGATIVE_EDGE  0x01
#define HIGH_LEVEL     0x02
#define LOW_LEVEL      0x03
#define DOUBLE_EDGE    0x04
//引脚工作模式
#define INPUT_MODE      0x00
#define OUTPUT_MODE     0x01
#define INTERRUPT_MODE  0x06
//引脚号计算
#define GPIO_A(num) (0   + num)
#define GPIO_B(num) (32  + num)
#define GPIO_C(num) (64  + num)
#define GPIO_D(num) (96  + num)
#define GPIO_E(num) (128 + num)
#define GPIO_F(num) (160 + num)
#define GPIO_G(num) (192 + num)
#define GPIO_H(num) (224 + num)
#define GPIO_I(num) (256 + num)

#define LEFT_SWITCH  GPIO_I(17)
#define RIGHT_SWITCH  GPIO_I(18)
#define EINT_CHANNEL_3  GPIO_I(19)
#define EINT_CHANNEL_1  GPIO_I(16)

#define RUN_RIGHT   1
#define RUN_LEFT   2

#endif